<!DOCTYPE html>
<html>
    <head>
        <title><?php echo get_option('site_title') ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="description" content="<?= get_option('site_meta_description') ?>">
        <meta name="keywords" content="<?= get_option('site_meta_keyword') ?>">
        <meta name="content" content="<?= get_option('site_meta_content') ?>">
        <meta name="author" content="Enjaz tech | انجاز التقنيه http://www.enjaz.net.sa">
        <link rel="icon" type="image/png" href="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/fav_<?= LANG ?>.png" >

        <link href="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>/views/<?php echo $this->themes->Cms_themes() ?>/css/style_<?= LANG ?>.css" rel="stylesheet" type="text/css">
        <!--[if lt IE 9]>
            <link rel="stylesheet" type="text/css" href="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/css/style-ie.css" />
        <![endif]-->

        <script type="text/javascript" src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/js/jquery-1.10.2.js"></script>

        <link href="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css">
        <script src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/js/jquery.mCustomScrollbar.concat.min.js"></script>
        <script>
            var base_url = '<?= base_url() ?>'
        </script>
        <script src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/js/cms_script.js" type="text/javascript"></script>
        <script>
                    (function($) {
                        $(window).load(function() {
                            $("#menu").mCustomScrollbar({
                                scrollInertia: 600,
                                autoDraggerLength: false,
                                scrollButtons: {enable: true}
                            });
                            $("#term").mCustomScrollbar({
                                scrollInertia: 400,
                                autoDraggerLength: true,
                                scrollButtons: {enable: true}
                            });
                            $("#pagesterm").mCustomScrollbar({
                                scrollInertia: 1200,
                                autoDraggerLength: true,
                                scrollButtons: {enable: true}
                            });
                        });
                    })(jQuery);
        </script>

        <script>
            (function(i, s, o, g, r, a, m) {
                i['GoogleAnalyticsObject'] = r;
                i[r] = i[r] || function() {
                    (i[r].q = i[r].q || []).push(arguments)
                }, i[r].l = 1 * new Date();
                a = s.createElement(o),
                        m = s.getElementsByTagName(o)[0];
                a.async = 1;
                a.src = g;
                m.parentNode.insertBefore(a, m)
            })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

            ga('create', 'UA-44254121-1', 'mtjar.com');
            ga('send', 'pageview');

        </script>


        <script src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/js/jquery.ui.core.js"></script>
        <script src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/js/jquery.ui.widget.js"></script>
        <script src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/js/jquery.ui.tabs.js"></script>
        <script>
            $(function() {
                $("#category_tabs").tabs();
            });
        </script>
    </head>
    <body>
<div id="loadingpage" style="text-align: center;width: 100%; background-color: white; height: 100%; z-index: 9999999; overflow: hidden; position: fixed;">
            <div style="margin: 20% auto"><img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/loading.gif" alt="" /></div>
        </div>
        <?php if($this->session_user_data['user_active'] == 'NO'){ ?>
        <div id="notregi" style="display: none">
            <div id="notregiback" style="width: 100%; background-color: black; height: 100%; z-index: 999998; overflow: hidden; position: fixed; opacity: 0.79;">&nbsp;</div>
            <div class="unsaved" style="font-size: 20px;background-color: white; width: 50%; z-index: 999999; overflow: hidden; position: fixed; margin: 12% 25%; color: #0579c3; border-radius: 15px 15px 15px 15px;">
                <div style="margin: auto"><img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/notactive.jpg" alt="" /></div>
                <div style="width: 70%; margin: 0 auto"><?= lang('message_dont_active') ?></div>
            </div>
        </div>
        <?php } ?>
        <div id="tpnav">
            <?php if ($this->admin_id && $this->user_id) { ?>
                <?php if ($this->site_close) { ?>
                    <div id="over_div_yellow">
                        <strong><?php echo str_replace(array('%admin_name%', '%user_name%'), array(session_date('admin_NAME'), session_date('user_NAME')), lang('message_login_as_site_close')) ?></strong>
                    </div>
                <?php } else { ?>
                    <div id="over_div_yellow">
                        <strong><?php echo str_replace(array('%admin_name%', '%user_name%'), array(session_date('admin_NAME'), session_date('user_NAME')), lang('message_login_as')) ?></strong>
                    </div>
                <?php } ?>
            <?php } elseif ($this->admin_id && $this->site_close) { ?>
                <div id="over_div_yellow">
                    <strong><?php echo lang('message_site_close') ?></strong>
                </div>
            <?php } ?>
            <?php $this->themes->display_message(); ?>
            <div class="wfix">
                <?php if ($this->user_id) { ?>
                    <ul>
                        <li class="first"></li>
                        <li class="first"><a href="<?= base_url('user/profile') ?>"><span class="sinin">&nbsp;</span><?= lang('label_welcome') . '... ' . session_date('user_NAME') . ' | ' . lang('label_profile') ?></a></li>
                        <li><a href="<?= base_url('mywallet') ?>"><?= lang('label_menu_link_mywallet') ?></a></li>
                        <li><a href="<?= base_url('invoicies') ?>"><?= lang('label_your_invoicies') ?></a></li>
                        <li><a href="<?= base_url('store') ?>"><?= lang('label_menu_link_mystore') ?></a></li>
                        <li><a href="<?= base_url('user/logout') ?>"><?= lang('lable_profile_logout') ?></a></li>
                    </ul>
                <?php } else { ?>
                    <ul>
                        <li class="first"><a href="<?= base_url('user/login') ?>"><span class="sinin">&nbsp;</span><?= lang('label_login') ?></a></li>
                        <li><a href="<?= base_url('user/register') ?>"><?= lang('label_new_user') ?></a></li>
                    </ul>
                <?php } ?>

                <ol>
                    <li><a href="<?= base_url('index/setlang') ?>"><?= lang('label_lang') ?></a></li>
                    <li><a href="<?= base_url('cart') ?>"><?= lang('label_shoping_cart') ?></a></li>
                    <li><a href="<?= base_url('wishlist') ?>"><?= lang('label_wishlist') ?></a></li>
                    <li><a href="<?= base_url('pages/view/faq') ?>"><?= lang('label_faq') ?></a></li>
                    <li class="first"><a href="<?= base_url('index/stores') ?>"><span class="stores">&nbsp;</span><?= lang('label_menu_link_stores') ?></a></li>
                </ol>
            </div>
        </div>

        <div id="header">
            <h1 id="logo"><a href="<?= base_url() ?>">&nbsp;</a></h1>
            <?php $categories = get_main_cats(); ?>
            <div id="searchbar">
                <form action="<?= base_url('products/advanced') ?>" method="post">
                    <div>
                        <input type="text" placeholder="<?= lang('label_search') ?>" name="keyword" autocomplete="off" />
                        <select name="maincat">
                            <option value="0" ><?= lang('label_all') ?></option>
                            <?php
                            if ($categories) {
                                foreach ($categories as $onecate) {
                                    $title = unserialize($onecate->title);
                                    ?>
                                    <option value="<?= $onecate->id ?>"><?= (isset($title[LANG])) ? $title[LANG] : ((LANG == 'ar') ? $title['en'] : $title['ar']) ?></option>
                                <?php } ?>

                            <?php } ?>

                        </select>
                    </div>
                    <input type="submit" value="." />
                </form>
                <a href="<?= base_url('products') ?>"><?= lang('label_advanced_search_label') ?></a>
                <span>
                    <a href="<?= base_url('cart') ?>"></a>
                    <strong><?= (int) $count = get_count_cart() ?></strong>
                    <?= ($count > 2 && $count < 11) ? lang('label_products') : lang('label_product') ?>
                </span>
            </div>
        </div>

        <div class="foot"><div class="wfix">
                <div class="wide_content">
                    <?php
                    if (!empty($file_contant) && end(explode('/', $file_contant)) == 'default') {
                        $this->view($this->themes->Cms_themes() . '/' . $file_contant);
                    } else {
                        $this->view($this->themes->Cms_themes() . '/' . $file_contant);
                    }
                    ?> 

                </div>
            </div></div>

        <div id="footer"><div class="footerfix">
                <div class="wfix">
                    <ul>
                        <li><h5><?= lang('label_home') ?></h5></li>
                        <li><a href="<?= base_url() ?>"><?= lang('label_home') ?></a></li>
                        <li><a href="<?= base_url('index/packages') ?>"><?= lang('label_membership') ?></a></li>
                        <li><a href="<?= base_url('pages/view/about-us') ?>"><?= lang('label_about_us') ?></a></li>
                        <li><a href="<?= base_url('index/contact') ?>"><?= lang('label_contact_us') ?></a></li>
                        <li><a href="<?= base_url('products') ?>"><?= lang('label_advanced_search') ?></a></li>
                    </ul>

                    <ul>
                        <li><h5><?= lang('label_services') ?></h5></li>
                        <li><a href="<?= base_url('pages/view/privacy') ?>"><?= lang('label_privacy_title') ?></a></li>
                        <li><a href="<?= base_url('pages/view/terms') ?>"><?= lang('label_term_of_use') ?></a></li>
                        <li><a href="<?= base_url('pages/view/advertise') ?>"><?= lang('label_how_to_adv') ?></a></li>
                    </ul>

                    <ul>
                        <li><h5><?= lang('label_plicies') ?></h5></li>
                        <li><a href="<?= base_url('index/payment_method') ?>"><?= lang('label_menu_link_payment') ?></a></li>
                        <li><a href="<?= base_url('index/shiping_method') ?>"><?= lang('label_menu_link_shippingcom') ?></a></li>
                        <li><a href="<?= base_url('pages/view/buyer-protection') ?>"><?= lang('label_buyer_protection') ?></a></li>
                        <li><a href="<?= base_url('pages/view/merchant-protection') ?>"><?= lang('label_merchant_protection') ?></a></li>
                        <li><a href="<?= base_url('pages/view/faq') ?>"><?= lang('label_faq') ?></a></li>
                    </ul>

                    <ul class="links">
                        <li><h5><?= lang('label_shop_categories') ?></h5></li>
                        <?php
                        $categories = get_main_cats(10, 'random');
                        if ($categories) {
                            ?>
                            <?php
                            $counter = 0;
                            $first = true;
                            foreach ($categories as $cat) {
                                $title = unserialize($cat->title);
                                if ($first) {
                                    $first = false;
                                    $counter++;
                                    echo '<li>';
                                } elseif ($counter++ % 2 == 0)
                                    echo '</li><li>';
                                ?>
                        <?php $title = (isset($title[LANG])) ? $title[LANG] : ((LANG == 'ar') ? $title['en'] : $title['ar']); ?>
                                <a href="<?= base_url("products/category/$cat->id").'/'.  str_replace(' ', '_', $title) ?>" title="<?= $title ?>"><?= $title ?></a>
                            <?php } ?>
                            <?php if (--$counter % 2 != 0) echo '</li>'; ?>
                        <?php } ?>
                    </ul>

                    <ul>
                        <li><h5><?= lang('label_menu_link_payment') ?></h5></li>
                        <li><a href="<?= base_url('index/payment_method') ?>"><img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/bank1.png" alt="" /></a> &nbsp;  
                            &nbsp;<a href="<?= base_url('index/payment_method') ?>"><img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/bank2.png" alt="" /></a> &nbsp;  
                            &nbsp;<a href="<?= base_url('index/payment_method') ?>"><img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/bank3.png" alt="" /></a></li>
                        <br />
                        <li><a class="paycash" href="<?= base_url('pages/view/pay-cash') ?>"></a></li>
                    </ul>    
                </div>

                <div class="wfix" style="border-top:1px solid #3b3b3b; margin-top:30px; padding-top:10px;">
                    <a class="foot_logo" href="<?= base_url() ?>"></a> <div>Service From <a href='http://www.enjaz.net.sa/' target="_blank">Enjaz Technology</a> <br />All Rights Reserved <?= date('Y') ?></div>

                    <div class="followus"><span><?= lang('label_follow_us') ?>:</span> 
                        <a href="<?= get_option('site_twitter') ?>"><img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/ffb.png" alt="" /></a> 
                        <a href="<?= get_option('site_facebook') ?>"><img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/ftw.png" alt="" /></a>
                    </div>
                </div>
            </div></div>

    </body>
</html>